This repository has no description
1<script lang="ts">
2 // the @ resets out of the profile shell, repo pages want their own header and
3 // tabs instead of the profile card
4 import { page } from "$app/state";
5 import RepoHeader from "$lib/components/repo/RepoHeader.svelte";
6 import RepoTabs from "$lib/components/repo/RepoTabs.svelte";
7
8 let { children, data } = $props();
9
10 const fullName = $derived(`${data.repo.ownerHandle}/${data.repo.name}`);
11 const repoUrl = $derived(`${page.url.origin}/${fullName}`);
12 const fullNameWithoutAt = $derived(fullName.replace(/^@/, ""));
13
14 const activeTab = $derived.by(() => {
15 const segment = page.route.id?.split("/")[3] ?? "";
16 return ["issues", "pulls", "pipelines", "settings"].includes(segment) ? segment : "overview";
17 });
18</script>
19
20<!-- todo: og and twitter card tags, the appview has repo/fragments/og.html -->
21<svelte:head>
22 <title>{fullName} · Tangled</title>
23 <meta name="description" content={data.repo.description ?? "A repository on Tangled"} />
24 <meta name="vcs:clone" content={repoUrl} />
25 <meta name="forge:summary" content={repoUrl} />
26 <meta name="forge:dir" content={`${repoUrl}/tree/{ref}/{path}`} />
27 <meta name="forge:file" content={`${repoUrl}/blob/{ref}/{path}`} />
28 <meta name="forge:line" content={`${repoUrl}/blob/{ref}/{path}#L{line}`} />
29 <meta
30 name="go-import"
31 content={`tangled.sh/${fullNameWithoutAt} git https://tangled.sh/${fullName}`}
32 />
33 <meta
34 name="go-import"
35 content={`tangled.org/${fullNameWithoutAt} git https://tangled.org/${fullName}`}
36 />
37</svelte:head>
38
39<section class="mx-auto w-full max-w-screen-lg py-6">
40 <RepoHeader repo={data.repo} counts={data.counts} viewerStarRkey={data.viewerStarRkey} />
41 <RepoTabs repo={data.repo} counts={data.counts} active={activeTab} />
42 {@render children()}
43</section>